package com.mzy.olddate.demo.init;//: initialization/ArrayNew.java
// Creating arrays with new.
import java.util.*;

public class ArrayNew {
  public static void main(String[] args) {
    int[] a;
    Random rand = new Random(47); // 数值定型  种子
    a = new int[rand.nextInt(20)];
    System.out.println(a.toString());   // 数组.toString() 默认打印出数组的名字和内存地址 --> 数组的名字是[I这里很有意思

    System.out.println("length of a = " + a.length);
    System.out.println(Arrays.toString(a));
  }
} /* Output:
length of a = 18
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
*///:~
